const { createProxyMiddleware } = require('http-proxy-middleware');

const server = 'https://sth-api.leyanbot.com/eci-thunder-api';

// eslint-disable-next-line func-names
module.exports = function (app) {
  app.use(createProxyMiddleware('/api', {
    target: server,
    changeOrigin: true,
    ws: true,
    pathRewrite: {
      '^/api': '',
    },
  }));
};
